
    <table id="vm" class="easyui-datagrid" title="Approval TopUp Point" style="height:400px"
                data-options="
                        url: '<?php echo $this->baseUrl() ?>/jsondata/adminordertopuppoint/',
                        fitColumns: false,
                        singleSelect: true,
                        rownumbers: true,
                        autoRowHeight:false,
                        pagination:true,
                        pageSize:10
                ">
        <thead>
                <tr>
                        <th data-options="field:'trans_dtm',width:120">Tgl Transaksi</th>
                        <th data-options="field:'transfer_dat',width:80">Tgl Transfer</th>
                        <th data-options="field:'acc_num1',width:100">Nomor Akun</th>
                        <th data-options="field:'amt_rp',width:80,align:'right'" align="right">Jumlah TopUp</th>
                        <th data-options="field:'acc_num2',width:200">Bank Akun</th>
                        <th data-options="field:'ket',width:120">Ket</th>
                        <th data-options="field:'follow',width:60,align:'center'" align="center">Follow Up</th>
                </tr>
        </thead>
    </table>


<script>
		function getData(){
                        var rows = [];

                        $.ajax({
                        type: 'GET',
                        dataType: 'json',
                        url: '<?php echo $this->baseUrl() ?>/jsondata/vmdata',
                        //data: {accNum: accNum},
                        success: function(result){
                                    //var balance = result.balance;

                                    //$('#balance').val(balance);
                                    //document.getElementById('balance').value = balance;

                                    var rows = [];
                                    for(var i=1; i<=result.length; i++){
                                            var amount = Math.floor(Math.random()*1000);
                                            var price = Math.floor(Math.random()*1000);
                                            rows.push({
                                                    trans_dtm: result[i]["trans_dtm"],
                                                    acc_num1: result[i]["acc_num1"],
                                                    amt_rp: result[i]["amt_rp"],
                                                    descr: result[i]["descr"]
                                            });
                                    }

                                    

                             }
                        });

                        
			return rows;
			
		}

		function pagerFilter(data){
                
			if (typeof data.length == 'number' && typeof data.splice == 'function'){	// is array
				data = {
					total: data.length,
					rows: data
				}
			}
			var dg = $(this);
			var opts = dg.datagrid('options');
			var pager = dg.datagrid('getPager');
			pager.pagination({
				onSelectPage:function(pageNum, pageSize){
					opts.pageNumber = pageNum;
					opts.pageSize = pageSize;
					pager.pagination('refresh',{
						pageNumber:pageNum,
						pageSize:pageSize
					});
					dg.datagrid('loadData',data);
				}
			});
			if (!data.originalRows){
				data.originalRows = (data.rows);
			}
			var start = (opts.pageNumber-1)*parseInt(opts.pageSize);
			var end = start + parseInt(opts.pageSize);
			data.rows = (data.originalRows.slice(start, end));
			return data;
		}

                /*
                $(function(){
			$('#vm').datagrid({loadFilter:pagerFilter}).datagrid('loadData', getData());
		});
                */
	</script>

            
      

